import { axiosOptions, axiosRequest } from '@/utils/request'

// 查询菜单列表
export function listMenu(query) {
  let options = axiosOptions('get')
  return axiosRequest('/resource/getAllResources',query,options);
}

//查询不是按钮的菜单列表，供新增删除选择上级菜单使用
export function getMenuNotButton(){
  let options = axiosOptions('get')
  return axiosRequest('/resource/getResources',null,options);
}

//根据id删除菜单
export function deleteMenu(ids){
  let options = axiosOptions(null,"application/json");
  return axiosRequest("/resource/delete",JSON.stringify({'deleteIds':ids}),options)
}

//查询所有菜单给角色分配权限的时候使用
export function getResourceToRole(query) {
  let options = axiosOptions('get')
  return axiosRequest('/resource/getResourceToRole',query,options);
}
